using System;
using System.Collections.Generic;
using System.Xml;
using Mehat.San.SanFS;
using System.IO;

namespace Mehat.San.SanFS.Cache
{
	public class FilenamePatternCachePolicy : ICachePolicy
	{
		private List<string> mRecentFilenames;
		
		private long CurrentCacheUsage;
		
		public FilenamePatternCachePolicy() {}
		
		public FilenamePatternCachePolicy(XmlNode CfgNode)
		{
			FileStream  fs = File.Create("/tmp/fnCache.dat");
   			BinaryWriter bw = new BinaryWriter(fs); 
		}
		
		public ICachePolicy CreateInstance(XmlNode CfgNode)
		{
			return new DummyCachePolicy(CfgNode);
		}
		
		public void FlushFile(FileHandle Handle)
		{
			Handle.File.VMount.FlushFile(Handle);
		}
		
		public long ReadFile(FileHandle Handle, byte []Buffer, long Offset)
		{
			return Handle.File.VMount.ReadFile(Handle, Buffer, Offset);
		}
		
		public void ReleaseFile(FileHandle Handle)
		{
			Handle.File.VMount.ReleaseFile(Handle);
		}
		
		public void OpenFile(FileHandle Handle)
		{
			Handle.File.VMount.OpenFile(Handle);
		}
		
		public string PolicyName
		{
			get { return "FilenamePattern"; }
		}
		
		

	}  // END CLASS
}  // END NAMESPACE
